/** @todo document */
class SearchEngine_TestCase extends PHPUnit_TestCase {
var $db, $search;
-
+
function insertSearchData() {
$this->db->safeQuery( <<<END
INSERT INTO ! (page_id,page_namespace,page_title,page_latest)
END
, $this->db->tableName( 'searchindex' ) );
}
-
+
function fetchIds( &$results ) {
$matches = array();
while( $row = $results->fetchObject() ) {
sort( $matches );
return $matches;
}
-
+
function testTextSearch() {
$this->assertFalse( is_null( $this->db ), "Can't find a database to test with." );
if( !is_null( $this->db ) ) {
"Plain search failed" );
}
}
-
+
function testTextPowerSearch() {
$this->assertFalse( is_null( $this->db ), "Can't find a database to test with." );
if( !is_null( $this->db ) ) {
"Power search failed" );
}
}
-
+
function testTitleSearch() {
$this->assertFalse( is_null( $this->db ), "Can't find a database to test with." );
if( !is_null( $this->db ) ) {
"Title search failed" );
}
}
-
+
function testTextTitlePowerSearch() {
$this->assertFalse( is_null( $this->db ), "Can't find a database to test with." );
if( !is_null( $this->db ) ) {
"Title power search failed" );
}
}
-
+
}